package com.collect.senegal.zhiScene.v2.zhiPerfermanceV2;

import android.annotation.SuppressLint;
import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.collect.senegal.R;
import com.collect.senegal.zhiBase.BaseActivity;
import com.collect.senegal.zhiGlobal.zhiAppSettings.ZHIProjectRouter;
import com.collect.senegal.zhiHelper.ZHIPerfermanceHelper;
import com.collect.senegal.zhiScene.zhiWidget.zhiMenuView.ZHIDetailTableView;
import com.collect.senegal.zhiScene.zhiWidget.zhiNavigationBar.ZHINavigationBar;

import butterknife.BindView;

@SuppressLint("NonConstantResourceId")
@Route(path = ZHIProjectRouter.ZHI_Perfermance_Detail)
public class ZHIPerfermanceDetailActivityV2 extends BaseActivity {
    @BindView(R.id.navigationBar)
    ZHINavigationBar navigationBar;

    @BindView(R.id.mtv_app)
    ZHIDetailTableView mtv_app;
    @BindView(R.id.mtv_date)
    ZHIDetailTableView mtv_date;
    @BindView(R.id.mtv_case_num)
    ZHIDetailTableView mtv_case_num;
    @BindView(R.id.mtv_repay_case_num)
    ZHIDetailTableView mtv_repay_case_num;

    @BindView(R.id.mtv_system_new_case_num)
    ZHIDetailTableView mtv_system_new_case_num;
    @BindView(R.id.mtv_system_new_case_repay_num)
    ZHIDetailTableView mtv_system_new_case_repay_num;
    @BindView(R.id.mtv_manual_case_num)
    ZHIDetailTableView mtv_manual_case_num;
    @BindView(R.id.mtv_manual_case_repay_num)
    ZHIDetailTableView mtv_manual_case_repay_num;
    @BindView(R.id.mtv_collect_rate)
    ZHIDetailTableView mtv_collect_rate;

    @Override
    protected void initInjector() {

    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_perfermance_detail_v2;
    }

    @Override
    protected void initView() {
        navigationBar.hideRight().setCenterText(getResources().getString(R.string.page_perfermance)).setBarClickListener(new ZHINavigationBar.OnNavigationBarClickListener() {
            @Override
            public void onNavigationBarLeftClick(View v) {
                ZHIPerfermanceHelper.getInstance().setPerfermanceEntity(null);
                finish();
            }

            @Override
            public void onNavigationBarRightClick(View v) {
            }
        });
        navigationBar.setLeftImgage(R.drawable.ic_91);
        navigationBar.showLeft();

        mtv_app.setDetailText(ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getAppId());
        mtv_date.setDetailText(ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getOverdueDate());
        mtv_case_num.setDetailText(ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getTotalCaseNum());
        mtv_repay_case_num.setDetailText(ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getTotalOverdueSettleOrderNum());

        mtv_system_new_case_num.setDetailText(ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getDayOverdueSysOrderNum());
        mtv_system_new_case_repay_num.setDetailText(ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getTotalOverdueSettleSysOrderNum());
        mtv_manual_case_num.setDetailText(ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getDayOverdueManuOrderNum());
        mtv_manual_case_repay_num.setDetailText(ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getTotalOverdueSettleManuOrderNum());

        String collectRateFormat = "(" +
                ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getTotalOverdueSettleManuOrderNum() +
                "+" +
                ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getTotalOverdueSettleSysOrderNum() +
                ")/" +
                ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getDayOverdueSysOrderNum() +
                "=" +
                ZHIPerfermanceHelper.getInstance().getPerfermanceEntity().getTotalOverdueSettleRate();

        mtv_collect_rate.setDetailText(collectRateFormat);
    }
}